package com.xaicode.auth.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xaicode.auth.annotation.Log;
import com.xaicode.auth.domain.Result;
import com.xaicode.auth.entity.SysOperLog;
import com.xaicode.auth.enums.BusinessType;
import com.xaicode.auth.security.domain.params.SysOperLogQueryParam;
import com.xaicode.auth.service.ISysOperLogService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 操作日志接口
 * 
 * @date 2024/12/19
 */
@RestController
@RequestMapping("/api/system/sysOperLog")
public class SysOperLogController {

    @Autowired
    private ISysOperLogService sysOperLogService;

    @Log(title = "查看日志列表", businessType = BusinessType.QUERY, isSaveResponseData = false)
    @SaCheckPermission("system:sysOperLog:list")
    @PostMapping("/page")
    public Result<?> page(@RequestBody SysOperLogQueryParam param) {
        PageInfo<SysOperLog> pageInfo = sysOperLogService.queryPage(param);
        return Result.ok(pageInfo);
    }

}
